package com.taijihuabao.modules.enums.optenums.checkin;

/**
 * 补卡审批枚举
 *
 * @author Tu
 * @date 2022/1/5 14:33
 */
public enum ReissueCardEnum {

    /**
     * 补卡流程部署id
     */
    ReissueCardKey("checkReissue", "补卡流程部署id"),
    /**
     * 先执行监听器
     */
    FirstEventName("create", "先执行监听器"),
    /**
     * 后执行监听器
     */
    LateEventName("delete", "后执行监听器"),
    /**
     * 审批人审核结果
     */
    ApproverOpinion("approverOpinion", "审批人意见"),
    /**
     * 连续主管审核结果
     */
    AdminOpinion("adminOpinion", "连续主管意见"),
    /**
     * 考勤专员审核结果
     */
    CheckInAttacheOpinion("checkInPersonOpinion", "考勤专员意见");


    private final String code;
    private final String message;

    ReissueCardEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    /**
     * 根据状态code获取枚举名称
     *
     * @return
     */
    public static String getMessageByCode(String code) {
        for (ReissueCardEnum status : ReissueCardEnum.values()) {
            if (status.getCode().equals(code)) {
                return status.message;
            }
        }
        return null;
    }

    /**
     * 根据状态code获取枚举值
     *
     * @return
     */
    public static ReissueCardEnum getByCode(String code) {
        for (ReissueCardEnum status : ReissueCardEnum.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
